G_OBJECT_CLASS (shell_generic_container_parent_class)->finalize (object);
}
-/* Based on implementation from clutter-group.c */
-static gboolean
-shell_generic_container_get_paint_volume (ClutterActor *actor,
- ClutterPaintVolume *volume)
-{
- GList *l, *children;
-
- children = st_container_get_children_list (ST_CONTAINER (actor));
-
- CLUTTER_ACTOR_CLASS (shell_generic_container_parent_class)->get_paint_volume (actor, volume);
-
- for (l = children; l != NULL; l = l->next)
- {
- ClutterActor *child = l->data;
- const ClutterPaintVolume *child_volume;
-
- /* This gets the paint volume of the child transformed into the
- * group's coordinate space... */
- child_volume = clutter_actor_get_transformed_paint_volume (child, actor);
- if (!child_volume)
- return FALSE;
-
- clutter_paint_volume_union (volume, child_volume);
- }
-
- return TRUE;
-}
-
static void
shell_generic_container_class_init (ShellGenericContainerClass *klass)
{
actor_class->get_preferred_width = shell_generic_container_get_preferred_width;
actor_class->get_preferred_height = shell_generic_container_get_preferred_height;
actor_class->allocate = shell_generic_container_allocate;
- actor_class->get_paint_volume = shell_generic_container_get_paint_volume;
actor_class->paint = shell_generic_container_paint;
actor_class->pick = shell_generic_container_pick;
StBoxLayout *self = ST_BOX_LAYOUT (actor);
gdouble x, y;
- CLUTTER_ACTOR_CLASS (st_box_layout_parent_class)->get_paint_volume (actor, volume);
+ if (!CLUTTER_ACTOR_CLASS (st_box_layout_parent_class)->get_paint_volume (actor, volume))
+ return FALSE;
/* When scrolled, st_box_layout_apply_transform() includes the scroll offset
* and affects paint volumes. This is right for our children, but our paint volume
G_OBJECT_CLASS (st_container_parent_class)->dispose (object);
}
+static gboolean
+st_container_get_paint_volume (ClutterActor *actor,
+ ClutterPaintVolume *volume)
+{
+ StContainerPrivate *priv = ST_CONTAINER (actor)->priv;
+ GList *l;
+
+ if (!CLUTTER_ACTOR_CLASS (st_container_parent_class)->get_paint_volume (actor, volume))
+ return FALSE;
+
+ if (!clutter_actor_get_clip_to_allocation (actor))
+ {
+ /* Based on ClutterGroup/ClutterBox; include the children's
+ * paint volumes, since they may paint outside our allocation.
+ */
+ for (l = priv->children; l != NULL; l = l->next)
+ {
+ ClutterActor *child = l->data;
+ const ClutterPaintVolume *child_volume;
+
+ child_volume = clutter_actor_get_transformed_paint_volume (child, actor);
+ if (!child_volume)
+ return FALSE;
+
+ clutter_paint_volume_union (volume, child_volume);
+ }
+ }
+
+ return TRUE;
+}
+
/* filter @children to contain only only actors that overlap @rbox
* when moving in @direction. (Assuming no transformations.)
*/
st_container_class_init (StContainerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
StContainerClass *container_class = ST_CONTAINER_CLASS (klass);
object_class->dispose = st_container_dispose;
+ actor_class->get_paint_volume = st_container_get_paint_volume;
+
widget_class->navigate_focus = st_container_navigate_focus;
container_class->get_focus_chain = st_container_real_get_focus_chain;
NULL);
}
-/* Based on implementation from clutter-group.c */
-static gboolean
-st_group_get_paint_volume (ClutterActor *actor,
- ClutterPaintVolume *volume)
-{
- GList *l, *children;
-
- children = st_container_get_children_list (ST_CONTAINER (actor));
-
- CLUTTER_ACTOR_CLASS (st_group_parent_class)->get_paint_volume (actor, volume);
-
- for (l = children; l != NULL; l = l->next)
- {
- ClutterActor *child = l->data;
- const ClutterPaintVolume *child_volume;
-
- /* This gets the paint volume of the child transformed into the
- * group's coordinate space... */
- child_volume = clutter_actor_get_transformed_paint_volume (child, actor);
- if (!child_volume)
- return FALSE;
-
- clutter_paint_volume_union (volume, child_volume);
- }
-
- return TRUE;
-}
-
static void
st_group_class_init (StGroupClass *klass)
actor_class->get_preferred_height = st_group_get_preferred_height;
actor_class->allocate = st_group_allocate;
actor_class->paint = st_group_paint;
- actor_class->get_paint_volume = st_group_get_paint_volume;
actor_class->pick = st_group_pick;
actor_class->show_all = st_group_show_all;
actor_class->hide_all = st_group_hide_all;